<style>
    #edui_fixedlayer{z-index: 200059999!important;}
</style>
<form style="padding:30px;" class="layui-form layui-form-pane formData">
    <div style="padding:30px" class="layui-form layui-form-pane">

        <input type="hidden" id="id" name="id" value="{$data.id}">

        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">名字：</label>
                <div class="layui-input-inline">
                    <input name="name" required lay-verify="required" placeholder="请输入名字" autocomplete="off" class="layui-input" value="{$data.name}">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">是否使用：</label>
                <div class="layui-input-inline">
                    <input {if condition='$data.is_use==2'} checked {/if} type="radio" name="is_use" value="2" title="是">
                    <input {if condition='$data.is_use==1'} checked {/if} type="radio" name="is_use" value="1" title="否">
                </div>
            </div>


        </div>


        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">appid：</label>
                <div class="layui-input-inline">
                    <input name="appid" required lay-verify="required" placeholder="请输入appid" autocomplete="off" class="layui-input" value="{$data.appid}">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">秘钥：</label>
                <div class="layui-input-inline">
                    <input name="secret" required lay-verify="required" placeholder="请输入秘钥" autocomplete="off" class="layui-input" value="{$data.secret}">
                </div>
            </div>
        </div>

    </div>
</form>

<script>
    //渲染表单
    layui.use('form', function(){
        var form = layui.form;
        form.render();

    });

    var _editor = UE.getEditor("edit_image", {
        initialFrameWidth: 800,
        initialFrameHeight: 300,
    });


    _editor.ready(function() {
        _editor.hide();
        _editor.addListener('beforeInsertImage', function(t, arg) {
            if (arg.length > 1) {
                layer.msg("最多只能选择1张图片，请重新选择");
                return false;
            }else {
                $("#image").attr("value",arg[0].src);
                $("#img_preview").attr("src",arg[0].src);
            }
            return true;
        });
    });


    //上传dialog
    function upImage() {

        var myImage = _editor.getDialog("insertimage");
        myImage.open();
    }

</script>
<textarea id="edit_image" style="display: none;"></textarea>